import { getUserListApi } from '@/service/api/businessApi';
export function userHooks() {
  const getUserList = async () => {
    const res = await getUserListApi({ pageNo: 1, pageSize: 1000 });
    if (res?.data?.data) return res.data.data;
    return [];
  };

  const getUserTypeText = (type: any) => {
    let txt = '';
    switch (type) {
      case 1:
        txt = '超级管理员';
        break;
      case 2:
        txt = '管理员';
        break;
      case 3:
        txt = '观察员';
        break;
      default:
        txt = '未知';
        break;
    }
    return txt;
  };

  return {
    getUserList,
    getUserTypeText
  };
}
